﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebNext.Domain.Entities;
using System.Web.Mvc;
using System.Xml.Serialization;
using WebNext.UI.Properties;
using WebNext.Domain;
using WebNext.UI.Utils;

namespace WebNext.UI.Models.Entries
{
	public abstract class EntryElementViewModel
	{
		public int Order
		{
			get;
			set;
		}

		public abstract EntryElementType Type
		{
			get;
		}

		public string EditViewName
		{
			get { return string.Format("Edit{0}", this.Type); }
		}

		public string ViewViewName
		{
			get { return string.Format("View{0}", this.Type); }
		}

		public string InputPrefix
		{
			get { return string.Format("{0}_{1}_", this.Order, this.Type); }
		}
		
		public EntryElementViewModel(int order)
		{
			this.Order = order;
		}
		
		public abstract EntryElement GetEntryElement();

		public abstract ValidationResult Validate();
	}
}